import { defineStore } from 'pinia'

export const useSimulationStore = defineStore('simulationStore', () => {
  const curPipeLine = ref('')
  const distance_variation_data = ref([])
  const distance_qx1 = ref([])
  const distance_qx2 = ref([])
  const time_variation_data = ref([])
  const fashi_data = ref([])
  const isRouteToPrediction = ref(false)
  const simulationTime = ref('10')
  const chartTimeInterval = ref(5)
  const predictPipeline = ref('')
  const batch_data = ref([])
  // 最小进站温度和最大出站压力
  const T_m_min = ref(0)
  const P_S_max = ref(0)

  const isShowQmin = ref(true)

  const T_g = ref('')
  const T_S_OUT = ref('')
  const min_flow_pump_speed = ref({})
  const max_flow_pump_speed = ref({})
  const operating_parameters = ref([])

  const safeStopTime = ref('')
  const temperature_time_variation = ref([])
  // 清管器运行专有
  const pig_data = ref([])
  // 全线专有
  const wb_oil = ref('WEHY')
  const batch_data_ty = ref([])
  const qx_pig_data = ref([])

  // ---------------------------------------------------------------能耗优化------------------------------------------------------------------------------------------------
  // 全线sps_id
  const sps_id = ref('')
  // 全线管线地温
  const T_g_WBX = ref('')
  const T_g_BKX = ref('')
  const T_g_701_ZZ = ref('')
  const T_g_81_701 = ref('')

  // 全线油品类型
  const Oil_in0 = ref('')
  const Oil_in1 = ref('')
  const Oil_in2 = ref('')

  // 全线乌百线的启输和停输时长
  const QS_time = ref('')
  const TS_time = ref('')

  // 参数校准得到的校准值
  const ruf_wbx = ref('0.4884')
  const K_G_wbx = ref('0.237')
  const K_F_wbx = ref('3.103')
  const ruf_bkx = ref('0.1313')
  const K_G_bkx = ref('2.682')
  const ruf_dyyx = ref('1.1955')
  const K_G_dyyx = ref('1.483')
  const ruf_81x = ref('0.5374')
  const K_G_81x = ref('1.6652')
  // 预测工况设置保存的图片
  const preditParams = ref(null)

  // 推广管道
  const curTGPipe = ref('')
  return {
    curPipeLine,
    distance_variation_data,
    distance_qx1,
    distance_qx2,
    time_variation_data,
    fashi_data,
    isRouteToPrediction,
    simulationTime,
    chartTimeInterval,
    predictPipeline,
    batch_data,
    T_m_min,
    P_S_max,
    pig_data,
    isShowQmin,
    T_g,
    T_S_OUT,
    min_flow_pump_speed,
    max_flow_pump_speed,
    operating_parameters,
    safeStopTime,
    temperature_time_variation,
    wb_oil,
    batch_data_ty,
    qx_pig_data,
    curTGPipe,
    T_g_WBX,
    T_g_BKX,
    T_g_701_ZZ,
    T_g_81_701,
    Oil_in0,
    Oil_in1,
    Oil_in2,
    QS_time,
    TS_time,
    sps_id,
    ruf_wbx,
    K_G_wbx,
    K_F_wbx,
    ruf_bkx,
    K_G_bkx,
    ruf_dyyx,
    K_G_dyyx,
    ruf_81x,
    K_G_81x,
    preditParams
  }
})
